﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ServiceStack.Redis;
using System.Data;

namespace RestFulService
{
    //操作redis
    public class myredis
    {
        string sSERVER = string.Empty;
        string sPORT = string.Empty;
        string sDATABASE = string.Empty;
        string sPASSWORD = string.Empty;
        public RedisClient client;
        DBSERVER myADO = new DBSERVER();

        //构造函数
        public myredis()
        {
            string str = System.Environment.CurrentDirectory + "\\WINBOX.ini";
            IniFile ini = new IniFile(str);
            sSERVER = ini.IniReadValue("redis", "SERVER");
            sPORT = ini.IniReadValue("redis", "PORT");
            sDATABASE = ini.IniReadValue("redis", "DATABASE");
            sPASSWORD = ini.IniReadValue("redis", "PASSWORD");
            //Console.WriteLine("数据库连接:" + ConnectionString);
            client = new RedisClient(sSERVER, int.Parse(sPORT), sPASSWORD, int.Parse(sDATABASE));
        }

        public void doSQLToRedis()
        {
            try
            {
                //数据添加
                //RedisClient client = new RedisClient(sSERVER, int.Parse(sPORT), sPASSWORD, int.Parse(sDATABASE));
                //client.Password = "hyisoft";
                client.FlushDb();//清空当前数据库中的所有key
                //client.FlushAll();//清空整个 Redis 服务器的数据（删除所有数据库的所有key）

                //1.添加门店资料
                string SQL = "select fOrgNo,fOrgName,fParentID,Easycardstoreid "
                  +" from Ts_Organize where fOrgType=2"
                  + " order by fParentID,fOrgNo";
                DataTable dbStore = myADO.query(SQL);
                if (dbStore is null || dbStore.Rows.Count == 0)
                {
                    Console.WriteLine("没有餐牌");
                }
                else
                {
                    for (int i = 0; i < dbStore.Rows.Count; i++)
                    {
                        deskStore myStore = new deskStore();
                        myStore.fOrgNo = dbStore.Rows[i]["fOrgNo"].ToString();
                        myStore.fOrgName = dbStore.Rows[i]["fOrgName"].ToString();
                        myStore.fParentID = dbStore.Rows[i]["fParentID"].ToString();
                        myStore.Easycardstoreid = dbStore.Rows[i]["Easycardstoreid"].ToString();

                        //加入redis
                        string classid = dbStore.Rows[i]["fOrgNo"].ToString() ;
                        client.Add<deskStore>(classid, myStore);

                        //3.添加收银员
                        SQL = "SELECT b.fParentID AS custId ,b.fOrgNo AS storeId,a.fEmpNo AS cashierID, a.fEmpName AS cashierName"
                         + "   ,a.fReportPW AS PasswordCode"
                         + "   ,upper(ISNULL(fRight01, 'N') + ISNULL(fRight02, 'N') + ISNULL(fRight03, 'N') + 'N' + ISNULL(fRight05, 'N')"
                         + "   + ISNULL(fRight04, 'N') + 'Y' + 'N' + ISNULL(fRight09, 'N') + ISNULL(fRight06, 'N')"
                         + "   + 'N' + 'N' + 'N' + ISNULL(fRight08, 'N') + 'N' + 'N'"
                         + "   + ISNULL(fRight11, 'N') + ISNULL(fRight10, 'N') + ISNULL(fRight13, 'N') + 'N' + 'N' + 'N' + 'N' + 'N'"
                         + "   + ISNULL(fRight12, 'N') + ISNULL(fRight14, 'N') + 'N' + 'N' + 'N' + 'N' + 'N' + 'N' + 'N')  AS GrpAuth"
                         + "   , fDiscAmt AS discAmt"
                         + " FROM Ts_Employee AS a"
                         + " INNER JOIN Ts_Organize AS b ON a.fOrgId = b.fOrgID and b.fOrgType = 2"
                         + " INNER JOIN Ts_PosGroup AS c on c.fPosGroup = a.fPosGroup"
                         + " where a.fEmpStatus = 1 "
                         + " and b.fOrgNo='"+ dbStore.Rows[i]["fOrgNo"].ToString() + "'";
                        DataTable dbCashier = myADO.query(SQL);
                        if (dbStore is null || dbStore.Rows.Count == 0)
                        {
                            Console.WriteLine("没有收银员");
                        }
                        else
                        {
                            cashierList mycashierList = new cashierList();

                            mycashierList.code = "100";
                            mycashierList.msg = "成功";

                            //第一层
                            cashierList.Content myContent = new cashierList.Content();

                            myContent.emplist = new List<cashier>();

                            for (int j = 0; j < dbCashier.Rows.Count; j++)
                            {
                                cashier mycashier = new cashier();
                                mycashier.custId = dbCashier.Rows[j]["custId"].ToString();
                                mycashier.storeId = dbCashier.Rows[j]["storeId"].ToString();
                                mycashier.cashierID = dbCashier.Rows[j]["cashierID"].ToString();
                                mycashier.cashierName = dbCashier.Rows[j]["cashierName"].ToString();
                                mycashier.PasswordCode = dbCashier.Rows[j]["PasswordCode"].ToString();
                                mycashier.GrpAuth = dbCashier.Rows[j]["GrpAuth"].ToString();
                                mycashier.discAmt = decimal.Parse(dbCashier.Rows[j]["discAmt"].ToString());

                                myContent.emplist.Add(mycashier);
                            }
                            mycashierList.content = myContent;

                            //加入redis
                            classid = dbStore.Rows[i]["fOrgNo"].ToString() + "-cashier";
                            client.Add<cashierList>(classid, mycashierList);
                        }
                    }
                }

                //2.添加餐牌资料
                SQL = "select b.fParentID custId,WAREHID,POSNO,MENUNO,SESSIONNAME"
                  +" from Ts_ItemSession a,Ts_Organize b"
                  +" where a.WAREHID = b.fOrgNo ";
                DataTable dtBigCat = myADO.query(SQL);
                if (dtBigCat is null || dtBigCat.Rows.Count == 0)
                {
                    Console.WriteLine("没有餐牌");
                    return;
                }

                //第一层
                for (int i = 0; i < dtBigCat.Rows.Count; i++)
                {
                    string sCustId= dtBigCat.Rows[i]["custId"].ToString();//客户编号
                    MenuItem myMenuItem = new MenuItem();

                    myMenuItem.code = "100";
                    myMenuItem.msg = "成功";

                    //第一层
                    MenuItem.Content myContent = new MenuItem.Content();
                    myContent.menuVersion = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                    myContent.menuCategoryTreeDTO = new List<MenuItem.MenuCategoryTreeDTOItem>();

                    //第二层 菜品大类
                    MenuItem.MenuCategoryTreeDTOItem myMenuCategoryTreeDTOItem = new MenuItem.MenuCategoryTreeDTOItem();
                    myMenuCategoryTreeDTOItem.categoryId = int.Parse(dtBigCat.Rows[i]["MENUNO"].ToString());
                    myMenuCategoryTreeDTOItem.categoryName = dtBigCat.Rows[i]["SESSIONNAME"].ToString();

                    myMenuCategoryTreeDTOItem.children = new List<MenuItem.ChildrenItem>();

                    string sMenuNo = dtBigCat.Rows[i]["MENUNO"].ToString();
                    SQL = " select Fseq,StoName,a.FMENUNO,a.MENUNAME "
                        + "  from Ts_ItemMenuDetail b,Ts_ItemMenu a"
                        + "  where a.FMENUNO = '" + sMenuNo + "'"
                        + "  and a.FMENUNO = b.fMenuNo"
                        + "  order by fseq";
                    DataTable dtMidCat = myADO.query(SQL);
                    for (int j = 0; j < dtMidCat.Rows.Count; j++)
                    {
                        //第三层 菜品小类
                        MenuItem.ChildrenItem mychildren = new MenuItem.ChildrenItem();
                        mychildren.categoryId = int.Parse(dtMidCat.Rows[j]["Fseq"].ToString()); ;
                        mychildren.categoryName = dtMidCat.Rows[j]["StoName"].ToString(); ;

                        mychildren.saleProductVoList = new List<MenuItem.SaleProductVoListItem>();

                        //菜品小类下商品
                        SQL = "  select b.fBarcode,b.fItemNo,b.fItemName,b.fSellPrice*100 fSellPrice,b.fMemberPrice*100 fMemberPrice"
                            + " ,b.fSaleUnit,b.fSpec,b.fItemtype,b.FDISCFLAG"
                            + " ,b.fBClassStNo,b.fMClassStNo,b.fClassStNo,ISNULL(c.Image,'') Image "
                            + "  from Ts_ItemMenuDetailSzi a"
                            + " inner join Ts_PLU b on b.custId="+ sCustId+" and a.fitemno = b.fItemNo"
                            + " left  join Ts_ImageList c on c.custId=b.custId and c.fitemno=b.fitemno"
                            + " where FMENUNO = '" + sMenuNo + "'"
                            + " and Fseq=" + dtMidCat.Rows[j]["Fseq"].ToString()
                            + " order by Tseq,Fseq";
                        DataTable dtMenuItem = myADO.query(SQL);
                        for (int k = 0; k < dtMenuItem.Rows.Count; k++)
                        {
                            //saleProductVoList
                            MenuItem.SaleProductVoListItem mysaleProductVoList = new MenuItem.SaleProductVoListItem();
                            mysaleProductVoList.customerCode = dtMenuItem.Rows[k]["fItemNo"].ToString();
                            mysaleProductVoList.erpCode = dtMenuItem.Rows[k]["fBarcode"].ToString();
                            mysaleProductVoList.productName = dtMenuItem.Rows[k]["fItemName"].ToString();
                            mysaleProductVoList.status = 1;
                            mysaleProductVoList.stock = null;
                            mysaleProductVoList.finalPrice = decimal.Parse(dtMenuItem.Rows[k]["fSellPrice"].ToString());
                            mysaleProductVoList.memberPrice = decimal.Parse(dtMenuItem.Rows[k]["fMemberPrice"].ToString());
                            mysaleProductVoList.promotionPrice = 0;
                            if (dtMenuItem.Rows[k]["Image"].ToString().Length > 0)
                            {
                                mysaleProductVoList.picture = "http://192.168.0.123:8090/Uploads/" + dtMenuItem.Rows[k]["Image"].ToString();
                            }
                            else
                            {
                                mysaleProductVoList.picture = "";
                            }
                            
                            mysaleProductVoList.type = dtMenuItem.Rows[k]["fItemtype"].ToString();
                            mysaleProductVoList.productGroupDTOList = null;
                            mysaleProductVoList.materialClassIdLarge = dtMenuItem.Rows[k]["fBClassStNo"].ToString();
                            mysaleProductVoList.materialClassIdMid = dtMenuItem.Rows[k]["fMClassStNo"].ToString();
                            mysaleProductVoList.materialClassIdSmall = dtMenuItem.Rows[k]["fClassStNo"].ToString();
                            mysaleProductVoList.allowFeedWayFlag = 1;
                            mysaleProductVoList.unitName = dtMenuItem.Rows[k]["fSaleUnit"].ToString();
                            mysaleProductVoList.addPriceBuyLog = null;
                            mysaleProductVoList.fdiscflag = int.Parse(dtMenuItem.Rows[k]["FDISCFLAG"].ToString());

                            //查询商品口味列表
                            mysaleProductVoList.skuAttrGroups = new List<MenuItem.SkuAttrGroupsItem>();
                            GetMenuAttr(dtMenuItem.Rows[k]["fItemNo"].ToString(), mysaleProductVoList);

                            //查询套餐明细
                            mysaleProductVoList.productGroupDTOList = new List<MenuItem.ProductGroupDTOListItem>();
                            if (dtMenuItem.Rows[k]["fItemtype"].ToString() == "7")
                            {
                                //套餐商品
                                GetBomAttr(dtMenuItem.Rows[k]["fItemNo"].ToString(), mysaleProductVoList);
                            }

                            //该商品加入库
                            mychildren.saleProductVoList.Add(mysaleProductVoList);
                        }

                        //添加菜品小类
                        myMenuCategoryTreeDTOItem.children.Add(mychildren);
                    }

                    //添加菜品大类
                    myContent.menuCategoryTreeDTO.Add(myMenuCategoryTreeDTOItem);

                    //添加第一层
                    myMenuItem.content = myContent;

                    //加入redis
                    string classid = dtBigCat.Rows[i]["WAREHID"].ToString() + "-" + dtBigCat.Rows[i]["POSNO"].ToString();
                    client.Add<MenuItem>(classid, myMenuItem);
                }

                myADO.Close();

                ////查询插入的数据
                //MenuItem Get_stud = client.Get<MenuItem>("500002-01");
                //if (Get_stud is null)
                //{
                //    Get_stud = new MenuItem();
                //    Get_stud.code = "0";
                //    Get_stud.msg = "失败";
                //    Console.WriteLine("没数据:" + Get_stud.msg.ToString());
                //}
                //else
                //{
                //    Console.WriteLine("找到有数据:" + Get_stud.msg.ToString());
                //}

                client.CloneClient();
                Console.WriteLine(DateTime.Now.ToLongTimeString().ToString() + ":" + "102.菜单接口redis加载完毕");
            }
            catch (Exception ex)
            {
                Console.WriteLine("redis加载出错:" + ex.Message);
            }
        }

        /// <summary>
        /// 商品口味
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        private void GetMenuAttr(string sItemNo, MenuItem.SaleProductVoListItem mysaleProductVoList)
        {
            string SQL = " select a.TASTECATNO,b.TASTECATNAME"
                         + " from ts_itemtaste a"
                         + " JOIN tbl_tasteReasonCat b  ON a.TASTECATNO = b.TasteCatno"
                         + " JOIN tbl_tasteReason c ON a.TASTENO = c.TasteNo"
                         + " WHERE a.FITEMNO = '" + sItemNo + "'"
                         + " group by a.TASTECATNO,b.TASTECATNAME";
            DataTable dtItemAttr1 = myADO.query(SQL);
            if (dtItemAttr1 is null || dtItemAttr1.Rows.Count == 0)
            {
                //Console.WriteLine("没有口味");
            }
            else
            {
                for (int l = 0; l < dtItemAttr1.Rows.Count; l++)
                {
                    MenuItem.SkuAttrGroupsItem myskuAttrGroups = new MenuItem.SkuAttrGroupsItem();
                    myskuAttrGroups.skuId = dtItemAttr1.Rows[l]["TASTECATNO"].ToString() + "'";
                    myskuAttrGroups.groupId = dtItemAttr1.Rows[l]["TASTECATNO"].ToString() + "'";
                    myskuAttrGroups.groupName = dtItemAttr1.Rows[l]["TASTECATNAME"].ToString() + "'";
                    myskuAttrGroups.choices = 0;
                    myskuAttrGroups.required = 1;

                    myskuAttrGroups.propertyList = new List<MenuItem.PropertyListItem>();

                    SQL = " select a.TASTECATNO,a.TASTENO,b.TASTECATNAME,c.TasteName,convert(numeric(7,0),c.ChangeAmt) ChangeAmt"
                     + " from ts_itemtaste a"
                     + " JOIN tbl_tasteReasonCat b  ON a.TASTECATNO = b.TasteCatno"
                     + " JOIN tbl_tasteReason c ON a.TASTENO = c.TasteNo"
                     + " WHERE a.FITEMNO = '" + sItemNo + "'"
                     + " and a.TASTECATNO='" + dtItemAttr1.Rows[l]["TASTECATNO"].ToString() + "'";
                    DataTable dtItemAttr2 = myADO.query(SQL);
                    for (int m = 0; m < dtItemAttr2.Rows.Count; m++)
                    {
                        MenuItem.PropertyListItem mypropertyList = new MenuItem.PropertyListItem();
                        mypropertyList.groupId = dtItemAttr2.Rows[m]["TASTENO"].ToString();
                        mypropertyList.propertyId = dtItemAttr2.Rows[m]["TASTENO"].ToString();
                        mypropertyList.propertyName = dtItemAttr2.Rows[m]["TasteName"].ToString();
                        mypropertyList.salePrice = "0";
                        mypropertyList.addPrice = int.Parse(dtItemAttr2.Rows[m]["ChangeAmt"].ToString());
                        mypropertyList.feedId = dtItemAttr2.Rows[m]["TASTENO"].ToString();
                        mypropertyList.feedNum = dtItemAttr2.Rows[m]["TASTENO"].ToString();
                        mypropertyList.feedName = dtItemAttr2.Rows[m]["TasteName"].ToString();
                        mypropertyList.feedNum = "1";
                        mypropertyList.defaultFlag = m;
                        //口味明细
                        myskuAttrGroups.propertyList.Add(mypropertyList);
                    }

                    //添加商品口味
                    mysaleProductVoList.skuAttrGroups.Add(myskuAttrGroups);
                }

            }
        }

        /// <summary>
        /// 商品套餐:套餐分类+套餐明细+商品口味
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        private void GetBomAttr(string sItemNo, MenuItem.SaleProductVoListItem mysaleProductVoList)
        {
            //套餐分类
            string SQL = " select findex,b.fItemNo,c.fClassStName,convert(int,a.ITEMQTY) ITEMQTY"
               + "  from Ts_ItemPackChip a,Ts_PLU b, Ts_ClassStore c"
               + "  where SUITNO = '" + sItemNo + "'"
               + " and a.fItemNo = b.fItemNo"
               + " and b.fClassStNo = c.fClassStNo"
               + " order by findex";
            DataTable dtItemAttr1 = myADO.query(SQL);
            if (dtItemAttr1 is null || dtItemAttr1.Rows.Count == 0)
            {
                //Console.WriteLine("没有套餐");
            }
            else
            {
                for (int l = 0; l < dtItemAttr1.Rows.Count; l++)
                {
                    MenuItem.ProductGroupDTOListItem myproductGroupDTOList = new MenuItem.ProductGroupDTOListItem();
                    myproductGroupDTOList.productId = dtItemAttr1.Rows[l]["fItemNo"].ToString();
                    myproductGroupDTOList.groupId = dtItemAttr1.Rows[l]["fItemNo"].ToString();
                    myproductGroupDTOList.groupName = dtItemAttr1.Rows[l]["fClassStName"].ToString();
                    myproductGroupDTOList.allowRepeat = 1;
                    myproductGroupDTOList.sequence = dtItemAttr1.Rows[l]["findex"].ToString();

                    myproductGroupDTOList.skuInfoDTOList = new List<MenuItem.SkuInfoDTOListItem>();

                    //套餐明细
                    SQL = " select  PARENTITEMNO,b.fbarcode,b.fItemNo,b.fItemName"
                     + " ,a.CHANGEAMT"
                     + " ,b.fBClassStNo,b.fMClassStNo,b.fClassStNo,b.fItemType"
                     + " ,b.fSellPrice,b.fSaleUnit"
                     + " from Ts_ItemPackChipDetail a,Ts_PLU b"
                     + " where SUITNO =  '" + sItemNo + "'"
                     + " and a.PARENTITEMNO='" + dtItemAttr1.Rows[l]["fItemNo"].ToString() + "'"
                     + "  and a.fItemNo = b.fItemNo"
                     + "  order by PARENTITEMNO,FINDEX";
                    DataTable dtItemAttr2 = myADO.query(SQL);
                    for (int m = 0; m < dtItemAttr2.Rows.Count; m++)
                    {
                        MenuItem.SkuInfoDTOListItem myskuInfoDTOList = new MenuItem.SkuInfoDTOListItem();
                        myskuInfoDTOList.customerCode = dtItemAttr2.Rows[m]["fItemNo"].ToString();
                        myskuInfoDTOList.skuId = dtItemAttr2.Rows[m]["fItemNo"].ToString();
                        myskuInfoDTOList.erpCode = dtItemAttr2.Rows[m]["fbarcode"].ToString();
                        myskuInfoDTOList.onlineName = dtItemAttr2.Rows[m]["fItemName"].ToString();
                        myskuInfoDTOList.subtitle = dtItemAttr2.Rows[m]["fItemName"].ToString();
                        myskuInfoDTOList.materialCategoryId = dtItemAttr2.Rows[m]["fBClassStNo"].ToString();
                        myskuInfoDTOList.materialClassIdMid = dtItemAttr2.Rows[m]["fMClassStNo"].ToString();
                        myskuInfoDTOList.materialClassIdSmall = dtItemAttr2.Rows[m]["fMClassStNo"].ToString();
                        myskuInfoDTOList.saleUnit = dtItemAttr2.Rows[m]["fSaleUnit"].ToString();
                        myskuInfoDTOList.salePrice = decimal.Parse(dtItemAttr2.Rows[m]["fSellPrice"].ToString());
                        myskuInfoDTOList.promotionPrice = 0;
                        myskuInfoDTOList.saleStatus = 1;
                        myskuInfoDTOList.addPrice = decimal.Parse(dtItemAttr2.Rows[m]["CHANGEAMT"].ToString());
                        myskuInfoDTOList.type = dtItemAttr2.Rows[m]["fItemType"].ToString();
                        myskuInfoDTOList.qty = int.Parse(dtItemAttr1.Rows[l]["ITEMQTY"].ToString());

                        //该商品口味
                        myskuInfoDTOList.skuAttrGroups = new List<MenuItem.SkuAttrGroupsItem>();
                        SQL = " select a.TASTECATNO,b.TASTECATNAME"
                         + " from ts_itemtaste a"
                         + " JOIN tbl_tasteReasonCat b  ON a.TASTECATNO = b.TasteCatno"
                         + " JOIN tbl_tasteReason c ON a.TASTENO = c.TasteNo"
                         + " WHERE a.FITEMNO = '" + dtItemAttr2.Rows[m]["fItemNo"].ToString() + "'"
                         + " group by a.TASTECATNO,b.TASTECATNAME";
                        DataTable dtItemAttr3 = myADO.query(SQL);
                        if (dtItemAttr3 is null || dtItemAttr3.Rows.Count == 0)
                        {
                            //Console.WriteLine("没有口味");
                        }
                        else
                        {
                            for (int i = 0; i < dtItemAttr3.Rows.Count; i++)
                            {
                                MenuItem.SkuAttrGroupsItem myskuAttrGroups = new MenuItem.SkuAttrGroupsItem();
                                myskuAttrGroups.skuId = dtItemAttr3.Rows[i]["TASTECATNO"].ToString() + "'";
                                myskuAttrGroups.groupId = dtItemAttr3.Rows[i]["TASTECATNO"].ToString() + "'";
                                myskuAttrGroups.groupName = dtItemAttr3.Rows[i]["TASTECATNAME"].ToString() + "'";
                                myskuAttrGroups.choices = 1;
                                myskuAttrGroups.required = 1;

                                myskuAttrGroups.propertyList = new List<MenuItem.PropertyListItem>();

                                SQL = " select a.TASTECATNO,a.TASTENO,b.TASTECATNAME,c.TasteName,convert(numeric(7,0),c.ChangeAmt) ChangeAmt"
                                 + " from ts_itemtaste a"
                                 + " JOIN tbl_tasteReasonCat b  ON a.TASTECATNO = b.TasteCatno"
                                 + " JOIN tbl_tasteReason c ON a.TASTENO = c.TasteNo"
                                 + " WHERE a.FITEMNO = '" + dtItemAttr2.Rows[m]["fItemNo"].ToString() + "'"
                                 + " and a.TASTECATNO='" + dtItemAttr3.Rows[i]["TASTECATNO"].ToString() + "'";
                                DataTable dtItemAttr4 = myADO.query(SQL);
                                for (int j = 0; j < dtItemAttr4.Rows.Count; j++)
                                {
                                    MenuItem.PropertyListItem mypropertyList = new MenuItem.PropertyListItem();
                                    mypropertyList.groupId = dtItemAttr4.Rows[j]["TASTENO"].ToString();
                                    mypropertyList.propertyId = dtItemAttr4.Rows[j]["TASTENO"].ToString();
                                    mypropertyList.propertyName = dtItemAttr4.Rows[j]["TasteName"].ToString();
                                    mypropertyList.salePrice = "0";
                                    mypropertyList.addPrice = int.Parse(dtItemAttr4.Rows[j]["ChangeAmt"].ToString());
                                    mypropertyList.feedId = dtItemAttr4.Rows[j]["TASTENO"].ToString();
                                    mypropertyList.feedNum = dtItemAttr4.Rows[j]["TASTENO"].ToString();
                                    mypropertyList.feedName = dtItemAttr4.Rows[j]["TasteName"].ToString();
                                    mypropertyList.feedNum = "1";
                                    mypropertyList.defaultFlag = j;

                                    //口味明细
                                    myskuAttrGroups.propertyList.Add(mypropertyList);
                                }

                                //添加商品口味
                                myskuInfoDTOList.skuAttrGroups.Add(myskuAttrGroups);
                            }
                        }

                        //套餐明细
                        myproductGroupDTOList.skuInfoDTOList.Add(myskuInfoDTOList);
                    }

                    //添加套餐分类
                    mysaleProductVoList.productGroupDTOList.Add(myproductGroupDTOList);

                }

            }
        }


    }
}
